Description | : The `Route Directions` API is an HTTP `POST` request that returns the ideal route between an origin and destination for automobile (driving), commercial trucks and walking routes. The route passes through a series of waypoints if specified. A waypoint is a geographical location defined by longitude and latitude that is used for navigational purposes. The route considers factors such as current traffic and the typical road speeds on the requested day of the week and time of day. The API returns the distance, estimated travel time, and a representation of the route geometry. More routing information such as an optimized waypoint order or turn by turn instructions is also available, depending on the parameters used. The Route Directions considers local laws, vehicle dimensions, cargo type, max speed, bridge and tunnel heights to calculate the truck specific routes and avoid complex maneuvers and difficult roads. Not all trucks can travel the same routes as other vehicles due to certain restrictions based on the vehicle profile or cargo type. For example, highways often have separate speed limits for trucks, some roads don't allow trucks with flammable or hazardous materials, and there can be height and weight restriction on bridges. Up to 25 waypoints and 10 viaWaypoints between any two waypoints is supported for driving and walking routes. Each set of waypoints creates a separate route Leg. ViaWaypoints define the route path and can be used for route creation through specific locations, but they don't create route Legs. Truck routes support up to 150 waypoints but don't support viaWaypoints. For information about routing availability in countries/regions, see [Azure Maps routing coverage](https://learn.microsoft.com/azure/azure-maps/routing-coverage?pivots=route-v2). >[!Important] >By using this feature, you agree to the preview legal terms. For more information, see [Preview Supplemental Terms](https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/). |
Reference | : Link ¶ |
⚶ Changes
{ "#id": "Route_PostDirections", "$parameters": { "routeDirectionsRequest": { "$properties": [ { "#name": "departAt", "Description": { "new": "The date and time of departure from the origin point formatted as a `dateTime` value defined by [RFC 3339, section 5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). When a time zone offset is not specified, UTC will be assumed.\n\nExample: \"departAt\": \"2023-06-01T09:30:00.000-07:00\"", "old": "The date and time of departure from the origin point formatted as a `dateTime` value defined by [RFC 3339, section 5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). When a time zone offset is not specified, UTC will be assumed.\n\nExamples:\n\n\"departAt\": \"2023-06-01T09:30:00.000-07:00\"" } } ] } } }
⚼ Request
POST:
/route/directions
{
api-version:
string
,
x-ms-client-id:
string
,
Accept-Language:
string
,
routeDirectionsRequest:
}
{
,
type:
enum
,
features:
[
]
,
{
,
type:
enum
,
geometry:
object
,
properties:
}
{
,
pointIndex:
integer
,
pointType:
enum
,
}
travelMode:
enum
,
departAt:
string
,
arriveAt:
string
,
optimizeRoute:
enum
,
optimizeWaypointOrder:
boolean
,
avoid:
[
,
string
,
]
routeOutputOptions:
[
,
string
,
]
maxRouteCount:
integer
,
heading:
integer
,
vehicleSpec:
}
{
,
isVehicleCommercial:
boolean
,
length:
number
,
width:
number
,
height:
number
,
weight:
integer
,
maxSpeed:
integer
,
axleWeight:
integer
,
axleCount:
integer
,
loadType:
}
[
,
string
,
]
⚐ Response (200)
{
$schema:
object
,
}
⚐ Response (default)
{
$headers:
{
,
x-ms-error-code:
string
,
}
$schema:
}
{
,
error:
}
{
,
code:
string
,
message:
string
,
target:
string
,
details:
[
,
string
,
]
innererror:
}
{
,
code:
string
,
innererror:
string
,
}